package grape.composite.service.bus.api;

import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import grape.composite.service.bus.po.Bus;
import grape.composite.service.bus.po.BusStation;
import grape.common.service.common.IBaseService;

/**
 * <p>
 * 公交站点表 服务类
 * </p>
 *
 * @author yangwei
 * @since 2020-09-10
 */
public interface IBusStationService extends IBaseService<BusStation> {
    /**
     * 判断编码是否已存在
     * @param code
     * @return
     */
    default boolean existCode(String code){
        assertParamNotEmpty(code,"code 不能为空");

        BusStation query = new BusStation();
        query.setCode(code);
        int r = count(Wrappers.query(query));
        return r > 0;
    }
}
